

const initCount = 1;

const reducer=(count=initCount, action)=>{

    switch(action.type){
        case "ADD":{
            let result = count + action.payload;
            console.log("result",result);
            return result;
        }
        case "MINUS":{
            let result = count - action.payload;
            console.log("result",result);
            return result;
        }
        default:
            return count;
    }
}

export default reducer;